package com.stockz.ui.swing.charting.display.indicator;

import java.awt.Graphics2D;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.stockz.core.util.ListUtil;
import com.stockz.ui.swing.charting.painter.indicator.BarIndicatorPainter;
import com.stockz.ui.swing.charting.util.UIChartingConstant.OVERLAY;

@Component
@Scope("prototype")
public class Value extends AbstractDisplayableIndicatorConfiguration {
	
	@Override
	public String getFullName() {
		return "Value";
	}

	@Override
	public String getShortName() {
		return "VAL";
	}
	
	@Override
	public String getDescription() {
		return getShortName()+","+getBarValueType();
	}

	@Override
	public OVERLAY getOverlay() {
		return OVERLAY.INDEPENDENT;
	}

	@Override
	public void paint(Graphics2D g) {
		BarIndicatorPainter.paint(g, this);
	}
	
	@Override
	public boolean isOverlappable() {
		return false;
	}

	@Override
	public Object getConfiguration() {
		return null;
	}

	@Override
	public void refreshValues() {
		setValues(ListUtil.convert(getStockChartPanel().getStockChartPanelState().getBarList(), getBarValueType()));
	}

}
